package com.settlement.system.service.impl;

import com.settlement.system.mapper.BrandUnitMapper;
import com.settlement.system.common.exception.ServiceException;
import com.settlement.system.model.entity.common.BrandUnit;
import com.settlement.system.service.IBrandUnitService;
import org.springframework.stereotype.Service;
import com.settlement.system.mapper.BaseMapper;
import jakarta.annotation.Resource;

/**
 * 品牌部表 服务实现类
 * @author xiaochuan
 * @since 2020-04-14
 */
@Service
public class BrandUnitServiceImpl extends BaseServiceImpl implements IBrandUnitService {

    @Resource
    private BrandUnitMapper brandUnitMapper;

    @Override
    public BaseMapper init() {
        return brandUnitMapper;
    }

    @Override
    public BrandUnit getByBrandUnitNo(String brandUnitNo) throws ServiceException {
        try {
            return brandUnitMapper.getByBrandUnitNo(brandUnitNo);
        } catch (Exception ex){
            throw new ServiceException("通过品牌部编码获取品牌部异常", ex);
        }
    }
}

